$(function(){
	//�ײ�news�ֲ� start
	var index = 0;
	$('.module-news .page-list>.page').on('click',function (e) {
		e.preventDefault();
//		clearInterval(timer);
		index = $(this).index();
		$(this).addClass('active').siblings('.page').removeClass('active');
		$('.slides-list .slide').hide().eq(index).fadeIn();
		console.log('index:'+index);
	});

	
	var maxlength = $('.module-news .slides-list .slide').length;
	var timer = setInterval(function(){
		if(index>maxlength-2){index=-1;}
		index++;
		$('.slides-list .slide').hide().eq(index).fadeIn();
		$('.module-news .page-list .page').removeClass('active').eq(index).addClass('active');
	},8000);
	//�ײ�news�ֲ� end
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        slidesPerView: 'auto',
        centeredSlides: true,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        paginationClickable: true,
        spaceBetween: 30
    });
    $('.module-third .media').mouseenter(function(){
		var index = $(this).index()+1;
		$(this).children('.media-body').children('img').attr('src',"/src/img/index-icon"+index+'hover.png');
	}).mouseleave(function () {
		var index = $(this).index()+1;
		$(this).children('.media-body').children('img').attr('src',"/src/img/index-icon"+index+'.png');
	});

    //禁止彈窗
    $('.module-third .media .media-body').click(function(e){
    	e.preventDefault();
//    	return false;
    });
    
    //禁止彈窗
  var dsp = null;
    $('.music-box').click(function(){
    	if($('.btn-play').attr('class')=="btn-play"){
    		$('.btn-play').addClass('btn-pause');
    	}
    	else{
    		$('.btn-play').removeClass('btn-pause');
    	}
		
	});
    
	var i = 0;
	var timer = setInterval(function () {
		i++;
		scale("#partyLogo",i);
	},50);
	function scale(target,deg){
		$(target).css("transform","rotate("+deg+"deg)").css("-webkit-transform","rotate("+deg+"deg)").css("-moz-transform","rotate("+deg+"deg)").css("-ms-transform","rotate("+deg+"deg)").css("-o-transform","rotate("+deg+"deg)");
	}
})
